package findMaxMin;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        int[] arr = new int[5];
        Scanner sc = new Scanner(System.in);
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            int num=sc.nextInt();
            arr[i] = num;
sum+=num;
        }

        System.out.println(sum);

        int max = arr[0];
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {

            if (arr[i] > max) {
                max = arr[i];
            }
            if (arr[i] < min) {
                min = arr[i];
            }
        }
        System.out.println(max);
        System.out.println(min);
        System.out.println("===============");

        int maxIndex = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > arr[maxIndex]) {
                maxIndex = i;
            }
        }
        int minIndex = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < arr[minIndex]) {
                minIndex = i;
            }
        }
        System.out.println(maxIndex);
        System.out.println(minIndex);
    }

//    public static int getMaxIndex(int[] arr) {
//        int max = arr[0];
//        for (int i = 0; i < arr.length; i++) {
//            if (arr[i] > max) {
//                max = arr[i];
//            }
//        }
//        return max;
//    }
//
//    public static int getMinIndex;
}
